﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// 
    /// </summary>
    public class ImageClip : BaseImageFilter
    {
        protected int m_nMin = 64;
        protected int m_nMax = 128;
        protected int m_nVMin = -1;
        protected int m_nVMax = -1;

        /// <summary>
        /// clips all channel values in image to lie in the default range.
        /// </summary>
        public ImageClip()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_nMin"></param>
        /// <param name="_nMax"></param>
        public ImageClip(int _nMin, int _nMax)
        {
            m_nMin = _nMin;
            m_nMax = _nMax;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_nMin"></param>
        /// <param name="_nMax"></param>
        /// <param name="_nVMin"></param>
        /// <param name="_nVMax"></param>
        public ImageClip(int _nMin, int _nMax, int _nVMin, int _nVMax)
            : this(_nMin, _nMax)
        {
        }

        /// <summary>
        /// Used by clone
        /// </summary>
        /// <param name="_imageClip"></param>
        internal ImageClip(ImageClip _imageClip)
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            int x=0;
            int y = 0;
            int nWidth = _bitmap.Width;
            int nHeight = _bitmap.Height;
            for (y = 0; y < nHeight; y++)
            {
                for (x = 0; x < nWidth; x++)
                {
                    Color color = _bitmap.GetPixel(x, y);
                    if (color.ToArgb() == 37)
                    {
                    }
                }
            }
            return _bitmap;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new ImageClip(this);
        }
    }
}
